package com.ai.entity.file;

import com.ai.entity.BasePage;
import com.ai.entity.alarm.RecordAlarmPO;
import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.util.CollectionUtils;

import java.util.Date;

/**
 * @Author：xiaosheng
 * @Date：2024/6/18 14:54
 */
@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AudioPage extends BasePage<Audio> {


    @ApiModelProperty(value = "数据添加时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;


    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "音频名")
    private String audioName;

    @ApiModelProperty(value = "音频后缀名")
    private String suffix;


    @Override
    public QueryWrapper<Audio> getQuery(QueryWrapper<Audio> queryWrapper) {

        return super.getQuery(queryWrapper).like(!StringUtils.isEmpty(remark),"remark",remark);
    }
}
